#include <iostream>
#include <string>
#include <cstring>
using namespace std;

size_t strlen1 (const char*);
size_t strlen2 (const char*);

int main(int argc, const char *argv[])
{
    string str;

    cout << "Please Input a String (Input EOF to Quit):" << endl;

    while (cin >> str)
    {
        cout << "strlen1 returns " << strlen1 (str.c_str())
             << endl;
        cout << "strlen2 returns " << strlen2 (str.c_str())
             << endl;
        cout << "strlen returns " << strlen (str.c_str())
             << endl << endl;
        cout << "Please Input a String (Input EOF to Quit):" << endl;
    }

    return 0;
}

size_t strlen1 (const char* str)
{
    int count = 0;
    while (str[count++])
        ;
    return count - 1;
}

size_t strlen2 (const char *str)
{
    int count = 0;
    while (*(str + count))
        count++;
    return count;
}
